﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.Net.TCP
{
    public abstract class BaseRequest<T> : IRequestHandler where T : class
    {
        public void Handle(NetClientProxy client, Package package)
        {
            T dataContract = BufferUtil.FromData<T>(package.Data);

            OnHandle(client, package, dataContract);
        }


        protected abstract void OnHandle(NetClientProxy client, Package package, T data);
    }
}
